package chapter03;

/**
 * ClassName: Java05_Exception
 * Package: chapter03
 * DESCRIPTION:
 *
 * @Author 程翎钥
 * @Create 2024/4/14 16:45
 * @Version 1.0
 */
public class Java05_Exception {
    public static void main(String[] args) {
        // TODO 异常
        //5. 格式化异常 ：java.lang.NumberFormatException
//        String s = "a123";
//        Integer i = Integer.parseInt(s);
//        System.out.println(i);

        //6.类型转换错误 ：java.lang.ClassCastException
        Object obj = new User5();
        //Emp5 emp = (Emp5) obj;
        if(obj instanceof Emp5) {
            Emp5 emp = (Emp5) obj;
        }
    }
}
class User5 {

}
class Emp5 {

}
